<template>
  <view class="setCell">
    <u--form labelPosition="left" :model="cellInfo" class="uForm">
      <u-form-item label="列1" prop="cell1" borderBottom>
        <u--input v-model="cellInfo.cell1" border="none" />
      </u-form-item>
      <u-form-item label="列2" prop="cell2" borderBottom>
        <u--input v-model="cellInfo.cell2" border="none" />
      </u-form-item>
      <u-form-item label="列3" prop="cell3" borderBottom>
        <u--input v-model="cellInfo.cell3" border="none" />
      </u-form-item>
      <u-form-item label="列4" prop="cell4" borderBottom>
        <u--input v-model="cellInfo.cell4" border="none" />
      </u-form-item>
      <u-form-item label="列5" prop="cell5" borderBottom>
        <u--input v-model="cellInfo.cell5" border="none" />
      </u-form-item>
      <u-form-item label="列6" prop="cell6" borderBottom>
        <u--input v-model="cellInfo.cell6" border="none" />
      </u-form-item>
      <u-form-item label="列7" prop="cell7" borderBottom>
        <u--input v-model="cellInfo.cell7" border="none" />
      </u-form-item>
      <u-form-item label="列8" prop="cell8" borderBottom>
        <u--input v-model="cellInfo.cell8" border="none" />
      </u-form-item>
      <u-form-item label="列9" prop="cell9" borderBottom>
        <u--input v-model="cellInfo.cell9" border="none" />
      </u-form-item>
    </u--form>
    <view class="footer">
      <u-button type="primary" text="设置" @click="btnClick" class="btn" />
    </view>
  </view>
</template>
<script>
export default {
  data() {
    return {
      cellInfo: {}
    };
  },
  onLoad() {
    this.cellInfo = uni.getStorageSync('cellInfo') || { cell1: '21.78', cell2: '57.78', cell3: '63.77', cell4: '213.77', cell5: '45.79', cell6: '27.82', cell7: '27.82', cell8: '63.78', cell9: '75.78' };
  },
  onShow() {},
  methods: {
    btnClick() {
      uni.showToast({ title: `设置成功`, icon: 'success', duration: 1200 });
      uni.setStorageSync('cellInfo', this.cellInfo);
    }
  }
};
</script>
<style lang="scss" scoped>
.setCell {
  position: relative;
  height: 100%;
  width: 100%;
  background: #f2f5f8;
  .uForm {
    padding: 0 16px;
    box-sizing: border-box;
    background: white;
  }
  .footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 10px 0;
    box-sizing: border-box;
    background: white;
    .btn {
      padding: 0 !important;
      width: calc(100% - 32px);
    }
  }
}
</style>
